package com.wysiwyg.admin.controller.system;

import com.wysiwyg.common.context.ContextUser;
import com.wysiwyg.common.model.dto.UserDTO;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/user")
@RefreshScope
public class UserController {

    @Value("${wwcc.name:12}")
    private String name;

    @PostMapping("/getCurrentUser")
    public UserDTO getCurrentUser(){
        return ContextUser.getUserInfo();
    }

    @PostMapping("/getName")
    public String getName(){
        return name;
    }

}
